<include file="public:header" />

<form action="{:U('store/create')}" method="post" name="myform" id="myform" class="lkcmsform">

<table width="100%" cellpadding="2" cellspacing="1" class="form-table">
<tbody>


	<tr> 
      <th width="60">{:L('标题')} :</th>
      <td><input type="text" name="title" id="title" class="input-text" value="" size="25" maxlength="100"></td>
    </tr>


    <!--
    <tr>
        <th width="60">{:L('省份')} :</th>
        <td>

            <select id="prov_id" name="prov_id" onchange="javascript: select_prov(this.value,'0');">
                <volist name="provlist" id="rec" >
                    <option value="{$rec['id']}" >{$rec['title']}</option>
                </volist>
            </select>

        </td>
    </tr>
    
    
    <tr>
        <th width="60">{:L('市区')} :</th>
        <td>

            <select id="city_id" name="city_id" onchange="javascript: select_city(this.value,'0');">
                
            </select>

        </td>
    </tr>
    
    
    <tr>
        <th width="60">{:L('街镇')} :</th>
        <td>

            <select id="street_id" name="street_id">
                
            </select>

        </td>
    </tr>
    -->
    
    <tr> 
      <th width="60">{:L('用户名')} :</th>
      <td><input type="text" name="username" id="username" class="input-text" value="" size="25" maxlength="100"></td>
    </tr>
    
    <tr> 
      <th width="60">{:L('密码')} :</th>
      <td><input type="text" name="password" id="password" class="input-text" value="" size="25" maxlength="100"></td>
    </tr>
    
    
    

<!--
    <tr>
        <th width="60">{:L('摘要')} :</th>
        <td><textarea id="summary" name="summary" cols="70" rows="3"></textarea></td>
    </tr>

	<tr> 
      <th width="60">{:L('详细内容')} :</th>
      <td>
          <textarea name="content" id="content"></textarea>
      </td>
    </tr>
-->




    <tr>
        <th width="60">{:L('顺序')} :</th>
        <td><input type="text" name="sort" id="sort" class="input-text" value="" size="25" maxlength="100" onkeyup="keyup_action3(this)"></td>
    </tr>

    
    <?php if($CurrAccount['Account-Role']=='administrator' || $CurrAccount['Account-Role']=='admin'){ ?>
    <tr>
      	<th>{:L('状态')} :</th>
      	<td>
      		<input type="radio" name="status" class="radio_style" value="1" checked /> &nbsp;{:L('发布')}&nbsp;&nbsp;&nbsp;
        	<input type="radio" name="status" class="radio_style" value="0" /> &nbsp;{:L('隐藏')}
      	</td>
    </tr>
    <?php }else{ ?>
    <tr>
      	<th>{:L('状态')} :</th>
      	<td>
      		<input type="hidden" name="status" value="0" /> 隐藏
      	</td>
    </tr>
    <?php } ?>
    
</tbody>
</table>
<table width="100%" cellpadding="2" cellspacing="1" class="form-table">
	<tfoot>
	<tr><th>
<input type="submit" name="dosubmit" id="dosubmit" class="button" value="确定" >
	</th></tr>
	</tfoot>
</table>
</form>
<script language="javascript" type="text/javascript" src="__ROOT__/scripts/ckeditor/ckeditor.js"></script>
<script language="javascript" type="text/javascript" src="__ROOT__/scripts/ckfinder/ckfinder.js"></script>
<script type="text/javascript">
/*
    function LK_BrowseServer(id, startupPath ) {
        var finder = new CKFinder();
        finder.BasePath = '__ROOT__/scripts/ckfinder/';
        finder.startupPath  = "Images:/" +  startupPath;
        finder.selectActionFunction = LK_SetFileField;
        finder.selectActionData = new Array(id, startupPath);
        finder.popup();
    }

    function LK_SetFileField(fileUrl, data) {
        var id = data["selectActionData"][0];
        jQuery("#" + id).val(fileUrl);
        jQuery("#" + id + "Preview").html("<img src='" + fileUrl + "' />");
    }


    $(function(){
        $(document).ready(function(){
            if (typeof CKEDITOR == "undefined") {
                //document.write("加载CKEditor失败");
            }
            else {
                var editor = CKEDITOR.replace("content");
                CKFinder.setupCKEditor(editor, "__ROOT__/scripts/ckfinder/"); //ckfinder总目录的相对路径.
            }
        });
    });
*/



    $(function(){
        var message_000 = "{:L('不能为空')}";
        $.formValidator.initConfig($.extend(true, {}, JPLUGIN_FORMVALIDATOR_CONFIG, {formID: 'myform'}));
        $("#title").formValidator({onShow:message_000,onFocus:message_000}).inputValidator({min:1,onError:"请输入标题"});
        $("#username").formValidator({onShow:message_000,onFocus:message_000}).inputValidator({min:1,onError:"请输入用户名"});
    	//$("#pic_show").formValidator({mode:'FixTip',onShow:message_000,onFocus:message_000}).inputValidator({min:1,onError:"请选择图片"});
    });







//切换省份，重置城市
function select_prov(pid,defaultid){
	$.get("{:U('store/ajax_select_prov')}", { pid: pid, defaultid: defaultid }, function(jsondata){
    	var status = jsondata.status;
    	var result = jsondata.result;
    	if( status == 'true'){
    		var divobj="#city_id";
    		$(divobj).html(result);
    		
    		select_city(document.myform.city_id.value,0);
    	}
	});
}


//切换城市，重置街镇
function select_city(pid,defaultid){
	$.get("{:U('store/ajax_select_city')}", { pid: pid, defaultid: defaultid }, function(jsondata){
    	var status = jsondata.status;
    	var result = jsondata.result;
    	if( status == 'true'){
    		var divobj="#street_id";
    		$(divobj).html(result);
    	}
	});
}


select_prov(document.myform.prov_id.value,0);




</script>

<include file="public:footer" />
